<template>
  <div class="pageHeader flex-row">
    <div class="headerTab">
      <button
        v-for="(tab, i) in tabs"
        :key="i"
        :class="['layui-btn', $route.name!==tab.name && 'layui-btn-primary']"
        @click="go(tab.route)">
        {{tab.label}}
      </button>
    </div>
    <slot></slot>
  </div>
</template>
<script>
export default {
  name: 'headerTabs',
  props: ['tabs'],
  methods: {
    go(route) {
      this.$router.push(route)
    },
  }
}
</script>
